{% extends 'layout.html' %}
{% block title %}新建用户{% endblock %}
{% load static %}
{% block css %}
    <link rel="stylesheet" href="{% static 'plugins/bootstrap-datepicker-1.9.0/css/bootstrap-datepicker.css' %}">
{% endblock %}

{% block content %}
    <div class="container">
    <div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title">新建用户</h3>
  </div>
  <div class="panel-body">
  <form method="post" action="/user/add/">
      {% csrf_token %}
  <div class="form-group">
    <label>姓名</label>
    <input type="text" class="form-control" name="user" placeholder="请输入用户姓名" style="margin-bottom: 10px">
  </div>
      <div class="form-group">
    <label>密码</label>
    <input type="text" class="form-control" name="pwd" placeholder="请输入用户密码" style="margin-bottom: 10px">
  </div>
  <div class="form-group">
    <label>年龄</label>
    <input type="text" class="form-control" name="age" placeholder="请输入用户年龄" style="margin-bottom: 10px">
  </div>
      <div class="form-group">
    <label>账户余额</label>
    <input type="text" class="form-control" name="account" placeholder="请输入用户账户余额" style="margin-bottom: 10px">
  </div>
      <div class="form-group">
    <label>入职时间</label>
    <input type="text" class="form-control" autocomplete="false" id="dt" name="create_date" placeholder="请输入用户入职时间" style="margin-bottom: 10px">
  </div>
      <div class="form-group">
    <label>性别</label>
    <select class="form-control" name="gender">
        {% for item in gender_choices %}
        <option value="{{ item.0 }}">{{ item.1 }}</option>
        {% endfor %}
    </select>
  </div>
      <div class="form-group">
    <label>部门</label>
  <select class="form-control"  name="depart" style="margin-bottom: 10px">
      {% for item in depart_list %}
        <option value="{{ item.id }}">{{  item.title }}</option>
      {% endfor %}
    </select>
      <button type="submit" class="btn btn-primary">提 交</button>
  </div>
</form>
  </div>
</div>
</div>
{% endblock %}

{% block js %}
    <script src="{% static 'plugins/bootstrap-datepicker-1.9.0/js/bootstrap-datepicker.js' %}"></script>
    <script src="{% static 'plugins/bootstrap-datepicker-1.9.0/locales/bootstrap-datepicker.zh-CN.min.js' %}"></script>
    <script>
    $(function (){
        $('#dt').datepicker({
            format: 'yyyy-mm-dd',
            startDate :'0',
            language: "zh-CN",
            autoclose: true
        });
    })
    </script>
{% endblock %}